using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using SolanumSolstice.Mapping;
using SolanumSolstice.Buildings;
using SolanumSolstice.Units.Weapons;


namespace SolanumSolstice.Units
{
    public class Soldier: Cop
    {
        public Soldier(ContentManager content, Vector2 position)
            : base(content, position)
        {   //'compared to' comments refer to previous class's attributes

            texture = content.Load<Texture2D>("Content\\Txtr\\Units\\Sprites\\mil_soldier_sheet");
            hudTexture = content.Load<Texture2D>("Content\\Txtr\\Units\\HUD\\copHUD");
            this.hitPoints = 25;  //compared to 18
            maxHitPoints = hitPoints;
            velocity = 1.0f;
            sightRadius = 5;
            attackPower = 3;   //compared to 2.0
            unitClass = UnitClass.Military;
            isCleansing = false;

            spawnCost = 16;  //compared to 8
            timeCost = 16;   //compared to 8

            weapon = new SubMachineGun(content);
            attackRadius = weapon.AttackRadius;
        }

        public override Object Clone()
        {
            Soldier u = new Soldier(this.content, this.position);

            u.weapon = this.weapon;
            u.hitPoints = this.hitPoints;
            u.maxHitPoints = this.maxHitPoints;
            u.recoveryTime = this.recoveryTime;
            u.initialRecoveryTime = this.initialRecoveryTime;
            u.position = this.position;
            u.velocity = this.velocity;
            u.sightRadius = this.sightRadius;
            u.attackRadius = this.attackRadius;
            u.attackPower = this.attackPower;
            u.isSelected = this.isSelected;
            u.isDead = this.isDead;
            u.isDying = this.isDying;
            u.isZombie = this.isZombie;
            u.inBuilding = this.inBuilding;
            u.isAttacking = this.isAttacking;
            u.actionSelected = this.actionSelected;
            u.actionReady = this.actionReady;
            u.rand = this.rand;
            u.actions = this.actions;
            u.currentActionIndex = this.currentActionIndex;
            u.targetReached = this.targetReached;
            u.direction = new Vector2(this.direction.X, this.direction.Y);
            u.unitClass = this.unitClass;

            u.isCleansing = this.isCleansing;
            u.targetBuilding = this.targetBuilding;

            u.timeCost = this.timeCost;
            u.spawnCost = this.spawnCost;

            return u;
        }
    }
}
